/*
 * PointTest.java
 * JMUnit based test
 *
 * Created on Apr 30, 2012, 10:45:52 AM
 */
package Point;

import jmunit.framework.cldc10.AssertionFailedException;
import jmunit.framework.cldc10.TestCase;

/**
 * @author Christianto
 */
public class PointTest extends TestCase {
    
    public PointTest() {
        //The first parameter of inherited constructor is the number of test cases
        super(5, "PointTest");
    }    
    
    public void test(int testNumber) throws Throwable {
        switch (testNumber) {
            case 0:
                testGetOrdinat();
                break;
            case 1:
                testAddOrdinat();
                break;
            case 2:
                testAddAbsis();
                break;
            case 3:
                testAdd();
                break;
            case 4:
                testGetAbsis();
                break;
            default:
                break;
        }
    }

    /**
     * Test of testGetOrdinat method, of class Point.
     */
    public void testGetOrdinat() throws AssertionFailedException {
        System.out.println("getOrdinat");
        Point instance = new Point(15.0, 3.0);
        double expResult_1 = 3.0;
        double result_1 = instance.getOrdinat();
        assertTrue(expResult_1 == result_1);
        //fail("The test case is a prototype.");
    }

    /**
     * Test of testAddOrdinat method, of class Point.
     */
    public void testAddOrdinat() throws AssertionFailedException {
        System.out.println("AddOrdinat");
        Point instance = new Point(15.0,3.0);
        double _y_1 = 2.0;
        instance.AddOrdinat(_y_1);
        double expResult_1 = 5.0;
        double result_1 = instance.getOrdinat();
        assertTrue(expResult_1 == result_1);
        //fail("The test case is a prototype.");
    }

    /**
     * Test of testAddAbsis method, of class Point.
     */
    public void testAddAbsis() throws AssertionFailedException {
        System.out.println("AddAbsis");
        Point instance = new Point(15.0,3.0);
        double _x_1 = 5.0;
        instance.AddAbsis(_x_1);
        double expResult_1 = 20.0;
        double result_1 = instance.getAbsis();
        assertTrue(expResult_1 == result_1);        
        //fail("The test case is a prototype.");
    }

    /**
     * Test of testAdd method, of class Point.
     */
    public void testAdd() throws AssertionFailedException {
        System.out.println("Add");
        Point instance = new Point(15.0,3.0);
        Point _p_1 = new Point(5.0,2.0);
        instance.Add(_p_1);
        
        Point expResult = new Point(20.0,5.0);
        assertEquals(instance, expResult);
        //fail("The test case is a prototype.");
    }

    /**
     * Test of testGetAbsis method, of class Point.
     */
    public void testGetAbsis() throws AssertionFailedException {
        System.out.println("getAbsis");
        Point instance = new Point(15.0,3.0);
        double expResult_1 = 15.0;
        double result_1 = instance.getAbsis();
        assertTrue(expResult_1 == result_1);
        //fail("The test case is a prototype.");
    }
}
